import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.*;
import javax.swing.*;

public class UserInterface{
	
	final boolean RIGHT_TO_LEFT = false;
	final boolean shouldFill = true;
	final boolean shouldWeightX = true;
	
	TextArea textL, textR;
	
	public static void main(String[] args) {
		UserInterface gui = new UserInterface();
	}
	
	public UserInterface(){
		createAndShowGUI();
	}
	
	public void addComponentsToPane(Container pane){
		
		if(RIGHT_TO_LEFT){
			pane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
		}
		
		pane.setLayout(new GridBagLayout());
		GridBagConstraints c = new GridBagConstraints();
		if(shouldFill){
			c.fill = GridBagConstraints.HORIZONTAL;
		}
		
		textL = new TextArea();
		if(shouldWeightX){
			c.weightx = 0.5;
		}
		c.fill = GridBagConstraints.HORIZONTAL;
		c.ipady = 300;
		c.ipadx = 500;
		c.weightx = 0.5;
		c.gridwidth = 3;
		c.gridx = 0;
		c.gridy = 0;
		c.anchor = GridBagConstraints.PAGE_END;
		pane.add(textL, c);
		
		textR = new TextArea();
		c.fill = GridBagConstraints.HORIZONTAL;
		c.ipady = 300;
		c.ipadx = 500;
		c.weightx = 0.5;
		c.gridwidth = 3;
		c.gridx = 0;
		c.gridy = 1;
		c.anchor = GridBagConstraints.PAGE_START;
		pane.add(textR, c);
	}
	
	private void createAndShowGUI(){
		JFrame frame = new JFrame("Battleship");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		addComponentsToPane(frame.getContentPane());
		
		frame.pack();
		frame.setVisible(true);
		
		frame.setLocation(500, 25);
	}
}